<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{mensagens.EditClienteTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{mensagens.EditClienteLabel_idPessoa}" for="idPessoa" />
                    <h:inputText id="idPessoa" value="#{clienteController.selected.idPessoa}" title="#{mensagens.EditClienteTitle_idPessoa}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_idPessoa}"/>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{clienteController.selected.nome}" title="#{mensagens.EditClienteTitle_nome}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_nome}"/>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_sobrenome}" for="sobrenome" />
                    <h:inputText id="sobrenome" value="#{clienteController.selected.sobrenome}" title="#{mensagens.EditClienteTitle_sobrenome}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_sobrenome}"/>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_cpf}" for="cpf" />
                    <h:inputText id="cpf" value="#{clienteController.selected.cpf}" title="#{mensagens.EditClienteTitle_cpf}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_cpf}"/>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_rg}" for="rg" />
                    <h:inputText id="rg" value="#{clienteController.selected.rg}" title="#{mensagens.EditClienteTitle_rg}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_rg}"/>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_dataNacimento}" for="dataNacimento" />
                    <h:inputText id="dataNacimento" value="#{clienteController.selected.dataNacimento}" title="#{mensagens.EditClienteTitle_dataNacimento}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_dataNacimento}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{mensagens.EditClienteLabel_endereco}" for="endereco" />
                    <h:inputText id="endereco" value="#{clienteController.selected.endereco}" title="#{mensagens.EditClienteTitle_endereco}" />
                    <h:outputLabel value="#{mensagens.EditClienteLabel_bairro}" for="bairro" />
                    <h:inputText id="bairro" value="#{clienteController.selected.bairro}" title="#{mensagens.EditClienteTitle_bairro}" />
                    <h:outputLabel value="#{mensagens.EditClienteLabel_email}" for="email" />
                    <h:inputText id="email" value="#{clienteController.selected.email}" title="#{mensagens.EditClienteTitle_email}" />
                    <h:outputLabel value="#{mensagens.EditClienteLabel_telefone}" for="telefone" />
                    <h:inputText id="telefone" value="#{clienteController.selected.telefone}" title="#{mensagens.EditClienteTitle_telefone}" />
                    <h:outputLabel value="#{mensagens.EditClienteLabel_cidadeIdCidade}" for="cidadeIdCidade" />
                    <h:selectOneMenu id="cidadeIdCidade" value="#{clienteController.selected.cidadeIdCidade}" title="#{mensagens.EditClienteTitle_cidadeIdCidade}" required="true" requiredMessage="#{mensagens.EditClienteRequiredMessage_cidadeIdCidade}">
                        <f:selectItems value="#{cidadeController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{clienteController.update}" value="#{mensagens.EditClienteSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{mensagens.EditClienteViewLink}"/>
                <br />
                <h:commandLink action="#{clienteController.prepareList}" value="#{mensagens.EditClienteShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{mensagens.EditClienteIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
